import request from '@/utils/request'

// 查询车辆信息列表
export function listVehicle(query) {
  return request({
    url: '/tws/vehicle/list',
    method: 'get',
    params: query
  })
}

// 所有车辆
export function listVehicleAll(query) {
  return request({
    url: '/tws/vehicle/listAll',
    method: 'get',
    params: query
  })
}

// 审核计数
export function getCertNum() {
  return request({
    url: '/tws/vehicle/getCertNum',
    method: 'get'
  })
}

// 查询车辆信息详细
export function getVehicle(id) {
  return request({
    url: '/tws/vehicle/' + id,
    method: 'get'
  })
}

// 新增车辆信息
export function addVehicle(data) {
  return request({
    url: '/tws/vehicle',
    method: 'post',
    data: data
  })
}

// 修改车辆信息
export function updateVehicle(data) {
  return request({
    url: '/tws/vehicle',
    method: 'put',
    data: data
  })
}

// 车辆审核
export function cert(data) {
  return request({
    url: '/tws/vehicle/cert',
    method: 'post',
    data: data
  })
}

// 车辆禁/启用
export function stateChange(data) {
  return request({
    url: '/tws/vehicle/stateChange',
    method: 'post',
    data: data
  })
}

// 删除车辆信息
export function delVehicle(id) {
  return request({
    url: '/tws/vehicle/' + id,
    method: 'delete'
  })
}

// 上传车辆
export function uploadVehicle(id) {
  return request({
    url: '/tws/vehicle/upload/' + id,
    method: 'get'
  })
}
